﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DigDes.DSchool.SUPS.DataAccess.Interface
{
    /// <summary>
    /// Пример класса переноса данных (модель). Отвечает к примеру за одну строку, считанную из файла
    /// </summary>
    public class MyLoader1DTO : LoaderBaseDTO
    {

        public MyLoader1DTO(string data)
        {
            this.WagonNumber = data.Substring(0, 8);
            this.Weight = data.Substring(8, 3);
            this.Destination = data.Substring(11, 5);
            this.CargoCode = data.Substring(16, 5);
            this.CodeOfConsignee = data.Substring(21, 4);
            this.TypeOfWagon = data.Substring(25, 2);
            this.FirstStation = data.Substring(27, 5);
            this.CodeOfOperation = data.Substring(32, 2);
            this.DateOfOperation = data.Substring(34, 4);
            this.YearOfOperation = data.Substring(38, 2);
            this.TimeOfOperation = data.Substring(40, 4);
            this.StationAchievementsOperations = data.Substring(44, 5);
            this.WayOfDelivery = data.Substring(49, 2);
            this.WayOfReception = data.Substring(51, 2);
            this.IndexOfTrain = data.Substring(53, 13);
            this.NumberOfTrain = data.Substring(66, 4);
        }

        public string WagonNumber { get; private set; }
        public string Weight { get; private set; }
        public string Destination { get; private set; }
        public string CargoCode { get; private set; }
        public string CodeOfConsignee { get; private set; }
        public string TypeOfWagon { get; private set; }
        public string FirstStation { get; private set; }
        public string CodeOfOperation { get; private set; }
        public string DateOfOperation { get; private set; }
        public string YearOfOperation { get; private set; }
        public string TimeOfOperation { get; private set; }
        public string StationAchievementsOperations { get; private set; }
        public string WayOfDelivery { get; private set; }
        public string WayOfReception { get; private set; }
        public string IndexOfTrain { get; private set; }
        public string NumberOfTrain { get; private set; }
    }
}
